import {Pipe, PipeTransform} from "@angular/core";

@Pipe({name: 'crlf2br'})
export class CRLF2BrPipe implements PipeTransform {

    transform(value: string): string {
        if (!value || value.trim().length === 0) {
            return '';
        }

        return value.replace(/[\n\r]/g, '<br/>');
    }
}